<%--<%@ include file="../common/top.jsp"%>--%>

<%--<div class="Back">--%>
<%--    <a href="mainForm" class="BackLink"><i class="fa-solid fa-circle-left"></i>Return to Main Menu</a>--%>
<%--</div>--%>

<%--<div class="Catalog">--%>
<%--<c:if test="${sessionScope.category != null}">--%>
<%--    <h2>${sessionScope.category.name}</h2>--%>
<%--</c:if>--%>
<%--    <c:if test="${sessionScope.category == null}">--%>
<%--        <h2></h2>--%>
<%--    </c:if>--%>

<%--<!----%>
<%--    <table>--%>
<%--        <tr>--%>
<%--            <th>Product ID</th>--%>
<%--            <th>Name</th>--%>
<%--        </tr>--%>

<%--        <c:forEach var="product" items="${sessionScope.productList}">--%>
<%--            <tr>--%>
<%--                <td>--%>
<%--                    <a href="productForm?productId=${product.productId}">${product.productId}</a>--%>
<%--                </td>--%>
<%--                <td>${product.name}</td>--%>
<%--            </tr>--%>
<%--        </c:forEach>--%>
<%--    </table>--%>
<%---->--%>
<%--    <div class="CategoryMain">--%>
<%--        <c:if test="${!empty sessionScope.productList}">--%>
<%--            <c:forEach var="product" items="${sessionScope.productList}">--%>

<%--                <div class="Category">--%>
<%--                    <div class="CategoryImg">--%>
<%--                        <a href="productForm?productId=${product.productId}" >${product.description.substring(0,product.description.indexOf(">"))} class="CategoryImgLink"></a>--%>
<%--                    </div>--%>
<%--                    <div class="CategoryName">--%>
<%--                        <b>--%>
<%--                            <a href="productForm?productId=${product.productId}" class="CategoryNameLink">${product.name}</a>--%>
<%--                        </b>--%>
<%--                    </div>--%>
<%--                        <div class="CategoryDescription">--%>
<%--                            <a href="productForm?productId=${product.productId}" class="CategoryDescriptionLink"> ${product.description.substring(product.description.indexOf(">")+1,product.description.length())}</a>--%>
<%--                        </div>--%>
<%--                    </div>--%>
<%--            </c:forEach>--%>
<%--        </c:if>--%>
<%--        <c:if test="${empty sessionScope.productList}">--%>
<%--            <h2>Sorry for that nothing was found here...</h2>--%>
<%--        </c:if>--%>
<%--    </div>--%>
<%--</div>--%>

<%--<%@ include file="../common/bottom.jsp"%>--%>























<%@ include file="../common/top.jsp"%>
<div class="Back">
    <a href="mainForm" class="BackLink"><i class="fa-solid fa-circle-left"></i>Return to Main Menu</a>
</div>

<div class="Catalog">
    <c:if test="${sessionScope.category != null}">
        <h2>${sessionScope.category.name}</h2>
    </c:if>
    <c:if test="${sessionScope.category == null}">
        <h2></h2>
    </c:if>

    <!--
    <table>
        <tr>
            <th>Product ID</th>
            <th>Name</th>
        </tr>

        <c:forEach var="product" items="${sessionScope.productList}">
            <tr>
                <td>
                    <a href="productForm?productId=${product.productId}">${product.productId}</a>
                </td>
                <td>${product.name}</td>
            </tr>
        </c:forEach>
    </table>
-->
    <div class="CategoryMain">
        <c:if test="${!empty sessionScope.productList}">
            <c:forEach var="product" items="${sessionScope.productList}">

                <div class="Category">
                    <div class="CategoryImg">
                        <a href="productForm?productId=${product.productId}" >${product.description.substring(0,product.description.indexOf(">"))} class="CategoryImgLink"></a>
                    </div>
                    <div class="CategoryName">
                        <b>
                            <a href="productForm?productId=${product.productId}" class="CategoryNameLink">Name: ${product.name}</a>
                        </b>
                    </div>
                    <div class="CategoryDescription">
                        <a href="productForm?productId=${product.productId}" class="CategoryDescriptionLink">Description: ${product.description.substring(product.description.indexOf(">")+1,product.description.length())}</a>
                    </div>
                </div>
            </c:forEach>
        </c:if>
        <c:if test="${empty sessionScope.productList}">
            <h2>Sorry for that nothing was found here...</h2>
        </c:if>
    </div>
</div>

<%@ include file="../common/bottom.jsp"%>